<div class='accordion'>
	<h3><a href="#">Persos</a></h3>
	<div>
		<div class='ui-widget-content ui-corner-all' style='padding-top: 5px; padding-bottom: 5px;' >
			<div style='height: 250px; overflow: auto;'>
				<table id='rosterPersosListe' cellspacing='0' cellpadding='0' style='width: 100%; border-top: 1px solid #000000;'>
					<?
					$i=0;
					$res=$sql->request("select * from ".CFG_MYSQL_PREFIX."player order by nom");
					$users=ident_get_users_list();
					foreach ($res as $var){
						$player= new player($var); ?>
					<tr>
						<td style='border-bottom: 1px solid #000000;'>
							<table cellspacing='0' style='width: 100%;'>
								<tr class='ui-state-default cursor-default' onmouseover='$(this).addClass("ui-state-hover");' onmouseout='$(this).removeClass("ui-state-hover");'>
									<td style=' width: 10px;'><img src='images/classes/<? echo $player->classe; ?>.gif' alt='' /></td>
									<td style=' width: 10px;'><img src='images/player/<? echo $player->race."-".$player->sexe; ?>.gif' alt='' /></td>
									<td style='width: 200px;'><? echo $player->nom; ?></td>
									<td class='text-petit' style='padding-left: 7px; width: 100px;'><? echo $cfg_params["list_rangs"][$player->grade]; ?></td>
									<td class='text-petit'>&nbsp;</td>
									<td class='text-petit tooltip' style='padding-left: 7px;width: 30px;' title='Date de mise à jour'><? $date = new DateTime($player->ts); echo $date->format("d/m/Y"); ?></td>
									<td class='pointer' style='width: 10px; padding-left: 2px; border-width: 0px; border-left: 1px solid #AAAAAA;'>
										<table cellspacing='0' cellpadding='0'>
											<tr>
												<td>
													<span id='rosterPersosUser<? echo $player->id; ?>Icon' class='ui-icon ui-icon-<? if($player->idUser==0) echo "minus"; else echo "person"; ?>'></span>
												</td>
												<td>
													<span class="ui-icon ui-icon-circle-triangle-w" id='rosterPersosToggleUser<? echo $player->id; ?>Button' onclick='rosterPersosToggleUser(<? echo $player->id; ?>);'></span>
												</td>
												<td id='rosterPersosUser<? echo $player->id; ?>' class='ui-helper-hidden'>
													<select onchange='rosterPersosChangeUser(<? echo $player->id; ?>,this);'>
														<option value='0'></option>
														<? foreach($users as $user){ ?>
														<option value='<? echo $user->id; ?>' <? if($user->id==$player->idUser) echo "selected='selected'"; ?>><? echo $user->nom; ?></option>
														<? } ?>
													</select>
												</td>
											</tr>
										</table>
									</td>
									<td class='pointer' style='width: 10px; padding-left: 2px; border-width: 0px; border-left: 1px solid #AAAAAA;' >
										<input type="checkbox" title='Roster Nocturne' <? if($player->casual == 1){ ?>checked="checked"<? } ?> onchange='rosterPlayerCasual(this, <? echo $player->idUser; ?>);'/>
									</td>
									<td class='pointer' style='width: 10px; padding-left: 2px; border-width: 0px; border-left: 1px solid #AAAAAA;' onclick="open_loading(); window.open('admin?confmodule=roster&action=MAJPerso&perso=<? echo $player->nom; ?>','_self');">
										<span class="ui-icon ui-icon-refresh tooltip" title='Mettre à jour ce perso'></span>
									</td>
									<td class='pointer' style='width: 10px; padding-left: 2px; border-width: 0px; border-left: 1px solid #AAAAAA;' onclick="open_dialog('Supprimer un perso', 'Etes-vous sur de vouloir supprimer ce perso?', { 'Non': function() { $(this).dialog('close'); }, 'Oui': function() { document.getElementById('formRosterPersosSupprimerPersoP<? echo $player->id; ?>').submit(); $(this).dialog('close'); open_loading(); } });">
										<span class="ui-icon ui-icon-circle-close tooltip" title='Supprimer ce perso'></span>
										<form name='formRosterPersosSupprimerPersoP<? echo $player->id; ?>' id='formRosterPersosSupprimerPersoP<? echo $player->id; ?>' action='' method='post'>
											<input type='hidden' name='id' value='<? echo $player->id; ?>' />
											<input type='hidden' name='action' value='supprimer_perso' />
										</form>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<? $i++; } ?>
				</table>
			</div>
		</div>
		<div class='align-center'>
			<table style='margin: auto;'>
				<tr>
					<td>
						<input type='text' id='rosterPersosAddPerso' />
					</td>
					<td><div class='div-icon ui-state-default ui-corner-all pointer tooltip' title='Ajouter ce perso'><span class="ui-icon ui-icon-circle-plus" onclick="rosterPersosAddPerso();"></span></div></td>
				</tr>
			</table>
		</div>
	</div>
	<h3><a href="#">Mise à jour de la guilde</a></h3>
	<div>
		<div class='ui-corner-all ui-widget-content'>
			<div id='rosterMAJProgress'></div>
			<div id='rosterMAJLog'></div>
		</div>
		<br />
		<div id='rosterMAJboutonMAJ' class='align-center'><a href="#" onclick="rosterMAJ();" class="a-button ui-state-default ui-corner-all"><span class="ui-icon ui-icon-link"></span>Lancer la mise à jour</a></div>
		<div id='rosterMAJAlerte' class="ui-state-error ui-corner-all ui-helper-hidden" style="padding: 3px; margin: 5px;"> 
			<p>
				<span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
				N'arretez en aucun cas le processus, laissez le se dérouler jusqu'à sa fin ou jusqu'à ce qu'il s'arrête de lui même.<br />
				Un arrêt prématuré poura occasioner des erreurs dans les données du roster.
			</p>
		</div>
		<br />
		<br />
	</div>
	<h3><a href="#">Rangs</a></h3>
	<div>
		<table>
			<tr>
				<td>
					<div class='rosterRangsSortable'>
						<? 
						$rangs=explode("|",$cfg_params["rangs"]);
						foreach($rangs as $rang){
							if($rang!=""){
								$rang=explode(":",$rang); ?>
						<div class='rosterRangsSortableItem'>
							<table cellspacing='0' cellpadding='1'>
								<tr>
									<td>
										<span class='ui-icon ui-icon-arrowthick-2-n-s' style='float: left;'></span>&nbsp;<span class='nom'><? echo $rang[0]; ?></span>
									</td>
									<td style='width: 10px; border-width: 0px; border-left: 1px solid #000000;' onmouseover='$(this).addClass("ui-state-hover");' onmouseout='$(this).removeClass("ui-state-hover");' onclick='rosterRangsToggle(this);'>
										<span class="ui-icon ui-icon-<? if($rang[1]==1) echo "check"; else echo "minus"; ?> tooltip" title='Récupérer les membres de ce rang'></span>
									</td>
									<td style='width: 10px; border-width: 0px; border-left: 1px solid #000000;' onmouseover='$(this).addClass("ui-state-hover");' onmouseout='$(this).removeClass("ui-state-hover");' onclick='rosterRangsSupprimer(this);'>
										<span class="ui-icon ui-icon-circle-close tooltip" title='Supprimer ce rang'></span>
									</td>
								</tr>
							</table>
						</div>
							<? }
						}?>
					</div>
					<input type='hidden' id='rangs' value='<? echo $cfg_params["rangs"]; ?>' />
					<table>
						<tr>
							<td><input type='text' name='rosterRangsAjouter' id='rosterRangsAjouter' /></td>
							<td><div class='div-icon ui-state-default ui-corner-all pointer tooltip' title='Ajouter ce rang' onclick="rosterRangsAjouter();"><span class="ui-icon ui-icon-circle-plus"></span></div></td>
						</tr>
					</table>
				</td>
				<td>
				</td>
			</tr>
		</table>
	</div>
</div>